import Vue from 'vue'
import App from './App.vue'
import 'element-ui/lib/theme-chalk/index.css'
import '../public/font/iconfont.css'
import '../public/base.css'
import router from './router'
import store from './store'
import VueI18n from 'vue-i18n'
import myFooter  from '@/components/myFooter'
import mySearch  from '@/components/gloal/mySearch'
import 'default-passive-events'
// import VueCookies from 'vue-cookies'
// import ElementUI from 'element-ui'
// 按需引入elementUI
import {
  Loading,
  Message,
  PageHeader
} from 'element-ui'
import CodeEditor from 'bin-code-editor';
Vue.use(CodeEditor);
Vue.use(PageHeader)
Vue.use(VueI18n);
Vue.use(Loading.directive)
Vue.component('myFooter',myFooter)
Vue.component('mySearch',mySearch)
Vue.prototype.$debounce = (fn,content,time=300,text)=>{
  clearTimeout(fn.timeId)
  fn.timeId=setTimeout(()=>{
    fn.call(content,text)
  },time)
}
Vue.prototype.$loading = Loading.service
Vue.prototype.$message = Message
let lang = localStorage.getItem('Language');
//let locale = lang || 'zh';
let locale = lang || '简体中文';

import messages from './lang/index'
const i18n = new VueI18n({
  locale,    // 语言标识, 通过切换locale的值来实现语言切换,this.$i18n.locale
  messages
})
document.title = messages[locale].web_title;
// Vue.use(VueCookies)
Vue.config.productionTip = false;
//let baseURL = process.env.NODE_ENV == 'development' ? 'http://192.168.1.27:8081' : location.origin;
let baseURL = process.env.NODE_ENV == 'development' ? 'http://119.45.113.164:8081' : location.origin;
localStorage.setItem('baseURL', baseURL);









new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
